#define  _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
//#define N 4
//#define Y(n) ((N + 2)* n)
//
//int main()
//{
//	printf("%d", 2 * (N + Y(5 + 1)));
//	return 0;
//}

//#define A 2+2
//#define B 3+3
//#define C A*B
//int main()
//{
//	printf("%d\n", C);
//  return 0;
//}
// 
//#include<stdio.h>
//#include<stddef.h>
//#define OFFSETOF(struct_name,member_name) (int)&(     (    (struct_name*) 0    )->member_name    )
//struct S
//{
//	char name[20];
//	int age;
//	float score;
//};
//
//int main()
//{
//	//printf("%d\n", offsetof(struct S, name)); //0
//	//printf("%d\n", offsetof(struct S, age));  //20
//	//printf("%d\n", offsetof(struct S, score)); //24
//	printf("%d\n", OFFSETOF(struct S, name));
//	printf("%d\n", OFFSETOF(struct S, age));
//	printf("%d\n", OFFSETOF(struct S, score));
//
//	return 0;
//}


#include<stdio.h>

#define CHANGE(num) ((((num) & 0xaaaaaaaa) >> 1) | (((num)& 0x55555555) << 1))  

int main()
{
	int num = 0;
	scanf("%d", &num);
	printf("%d\n", CHANGE(num));
	return 0;
}